<?php
include("../sesiune.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>editProd</title>
</head>
<body>
<?php
$query ="SELECT numeProd, detalii, pret, ID, upload FROM produse ORDER BY id";
$showProd = mysql_query($query,getConnection()) or die (mysql_error());
$nr = mysql_num_rows($showProd);
if($nr>0)
{
	while ($displayProd= mysql_fetch_array($showProd)) 
	{
		echo "<table><tr><td>Nume</td><td>$displayProd[numeProd]</td></tr><tr><td>Detalii</td><td>$displayProd[detalii]</td></tr><tr><td>Pret</td><td>$displayProd[pret]</td></tr></table>"."<br/>";
		
?>
		<form action="edit.php" method="get">
		<input type="hidden" name="id" value="<?php echo $displayProd["ID"];?>" >
		<input type="submit" value="Edit me!">
		<a href="../adminPage.php"><input type="button" value="Cancel"></a>
		</form>
		
<?php 
	}
}
else
{
	echo "<div style='background:red;color:white;font-weight:bold;'>Nu exista produse</div>";
}
?>		

</body>
</html>
